﻿<UserControl x:Class="Tech4WPF.Common.RoundScalePart" x:ClassModifier="internal"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" 
             xmlns:local="clr-namespace:Tech4WPF.Common"  
             x:Name="roundScalePart"
             mc:Ignorable="d">
    <UserControl.Resources>
        <local:ScaleAngleConverter x:Key="scaleAngleConverter" />
    </UserControl.Resources>
    <Viewbox RenderTransformOrigin="0.5,0.5">
        <Grid Width="185" Height="140" RenderTransformOrigin="0.5,0.5" x:Name="scaleGrid">
            <Path x:Name="templateMinorStamp" Data="M82,19 L82,26" Fill="#FFF4F4F5" Height="8" 
                  Margin="82,13.004,82,0" Stretch="Fill" VerticalAlignment="Top" 
                  Stroke="{Binding ElementName=roundScalePart, Path=MinorStampStroke}" 
                  RenderTransformOrigin="0.5,7.124" Visibility="Hidden"/>
            <Path x:Name="templateMajorStamp" Data="M83,26 L83,16.521" Fill="#FFF4F4F5" Height="12.479" 
                  Stretch="Fill" Stroke="{Binding ElementName=roundScalePart, Path=MajorStampStroke}" 
                  StrokeThickness="3" Margin="81,9.497,81,0" VerticalAlignment="Top" 
                  RenderTransformOrigin="0.501,4.848" Panel.ZIndex="1" Visibility="Hidden"/>
            <ed:Arc x:Name="arc" ArcThickness="0" ArcThicknessUnit="Pixel" 
                    EndAngle="{Binding ElementName=roundScalePart, Path=EndAngle, 
                        Converter={StaticResource scaleAngleConverter}, ConverterParameter=EndAngle}" 
                    StartAngle="{Binding ElementName=roundScalePart, Path=StartAngle, 
                        Converter={StaticResource scaleAngleConverter}, ConverterParameter=StartAngle}" 
                    Fill="#FFF4F4F5" StrokeThickness="3" 
                    Stretch="None" Stroke="{Binding ElementName=roundScalePart, Path=ScaleStroke}"  
                    Width="100" Height="100" Panel.ZIndex="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        </Grid>
    </Viewbox>
</UserControl>
